import request from '@/utils/request'

// 查询仓库列表
export function listStock(query) {
  return request({
    url: '/wms/wms/stock/list',
    method: 'get',
    params: query
  })
}

// 查询仓库列表
export function listStockUuid(query) {
  return request({
    url: '/wms/wms/stock/uuid',
    method: 'get',
    params: query
  })
}
// 按条件查询仓库列表
export function listStockByWmsDictStockType(wmsDictStockType) {
  return request({
    url: '/wms/wms/stock/listStockByWmsDictStockType/'+wmsDictStockType,
    method: 'get',
  })
}

// 查询仓库详细
export function getStock(stockUuid) {
  return request({
    url: '/wms/wms/stock/' + stockUuid,
    method: 'get'
  })
}

// 新增仓库
export function addStock(data) {
  return request({
    url: '/wms/wms/stock',
    method: 'post',
    data: data
  })
}

// 修改仓库
export function updateStock(data) {
  return request({
    url: '/wms/wms/stock',
    method: 'put',
    data: data
  })
}
// 修改仓库
export function updateAllStock(data) {
  console.log(data)
  return request({
    url: '/wms/wms/stock/all',
    method: 'put',
    data: data
  })
}

// 删除仓库
export function delStock(stockUuid) {
  return request({
    url: '/wms/wms/stock/' + stockUuid,
    method: 'delete'
  })
}
